using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace DTO
{
	/// <summary> 
	///Author: nnamthach@gmail.com 
	/// <summary>
	
    public class SSRFCVDInfo
    {
		#region Local Variable
		public enum Field
		{
			SUN_DB,
			CODE,
			LOOKUP,
			UPDATED,
			CONV_NAME,
			CURR_NAME,
			USE_DAILY,
			DAY_LIMIT,
			NET_ACCT_REAL,
			LOSS_ACCT_REAL,
			GAIN_ACCT_REAL,
			NET_ACCT_NON_REAL,
			LOSS_ACCT_NON_REAL,
			GAIN_ACCT_NON_REAL,
			PAYMENT_AC,
			DEBIT_AC,
			DEC_PLACES,
			CURR_UNIT_NAME,
			CURR_GENDER,
			EURO_ZERO_TOL
		}
		private String _SUN_DB;
		private String _CODE;
		private String _LOOKUP;
		private String _UPDATED;
		private String _CONV_NAME;
		private String _CURR_NAME;
		private String _USE_DAILY;
		private Int32 _DAY_LIMIT;
		private String _NET_ACCT_REAL;
		private String _LOSS_ACCT_REAL;
		private String _GAIN_ACCT_REAL;
		private String _NET_ACCT_NON_REAL;
		private String _LOSS_ACCT_NON_REAL;
		private String _GAIN_ACCT_NON_REAL;
		private String _PAYMENT_AC;
		private String _DEBIT_AC;
		private String _DEC_PLACES;
		private String _CURR_UNIT_NAME;
		private String _CURR_GENDER;
		private String _EURO_ZERO_TOL;
		
		public String SUN_DB{	get{ return _SUN_DB;} set{_SUN_DB = value;} }
		public String CODE{	get{ return _CODE;} set{_CODE = value;} }
		public String LOOKUP{	get{ return _LOOKUP;} set{_LOOKUP = value;} }
		public String UPDATED{	get{ return _UPDATED;} set{_UPDATED = value;} }
		public String CONV_NAME{	get{ return _CONV_NAME;} set{_CONV_NAME = value;} }
		public String CURR_NAME{	get{ return _CURR_NAME;} set{_CURR_NAME = value;} }
		public String USE_DAILY{	get{ return _USE_DAILY;} set{_USE_DAILY = value;} }
		public Int32 DAY_LIMIT{	get{ return _DAY_LIMIT;} set{_DAY_LIMIT = value;} }
		public String NET_ACCT_REAL{	get{ return _NET_ACCT_REAL;} set{_NET_ACCT_REAL = value;} }
		public String LOSS_ACCT_REAL{	get{ return _LOSS_ACCT_REAL;} set{_LOSS_ACCT_REAL = value;} }
		public String GAIN_ACCT_REAL{	get{ return _GAIN_ACCT_REAL;} set{_GAIN_ACCT_REAL = value;} }
		public String NET_ACCT_NON_REAL{	get{ return _NET_ACCT_NON_REAL;} set{_NET_ACCT_NON_REAL = value;} }
		public String LOSS_ACCT_NON_REAL{	get{ return _LOSS_ACCT_NON_REAL;} set{_LOSS_ACCT_NON_REAL = value;} }
		public String GAIN_ACCT_NON_REAL{	get{ return _GAIN_ACCT_NON_REAL;} set{_GAIN_ACCT_NON_REAL = value;} }
		public String PAYMENT_AC{	get{ return _PAYMENT_AC;} set{_PAYMENT_AC = value;} }
		public String DEBIT_AC{	get{ return _DEBIT_AC;} set{_DEBIT_AC = value;} }
		public String DEC_PLACES{	get{ return _DEC_PLACES;} set{_DEC_PLACES = value;} }
		public String CURR_UNIT_NAME{	get{ return _CURR_UNIT_NAME;} set{_CURR_UNIT_NAME = value;} }
		public String CURR_GENDER{	get{ return _CURR_GENDER;} set{_CURR_GENDER = value;} }
		public String EURO_ZERO_TOL{	get{ return _EURO_ZERO_TOL;} set{_EURO_ZERO_TOL = value;} }
		
        #endregion LocalVariable
        
        #region Constructor
		public SSRFCVDInfo()
		{
			_SUN_DB = "";
			_CODE = "";
			_LOOKUP = "";
			_UPDATED = "";
			_CONV_NAME = "";
			_CURR_NAME = "";
			_USE_DAILY = "";
			_DAY_LIMIT = 0;
			_NET_ACCT_REAL = "";
			_LOSS_ACCT_REAL = "";
			_GAIN_ACCT_REAL = "";
			_NET_ACCT_NON_REAL = "";
			_LOSS_ACCT_NON_REAL = "";
			_GAIN_ACCT_NON_REAL = "";
			_PAYMENT_AC = "";
			_DEBIT_AC = "";
			_DEC_PLACES = "";
			_CURR_UNIT_NAME = "";
			_CURR_GENDER = "";
			_EURO_ZERO_TOL = "";
		}
		public SSRFCVDInfo(
		String SUN_DB,
		String CODE,
		String LOOKUP,
		String UPDATED,
		String CONV_NAME,
		String CURR_NAME,
		String USE_DAILY,
		Int32 DAY_LIMIT,
		String NET_ACCT_REAL,
		String LOSS_ACCT_REAL,
		String GAIN_ACCT_REAL,
		String NET_ACCT_NON_REAL,
		String LOSS_ACCT_NON_REAL,
		String GAIN_ACCT_NON_REAL,
		String PAYMENT_AC,
		String DEBIT_AC,
		String DEC_PLACES,
		String CURR_UNIT_NAME,
		String CURR_GENDER,
		String EURO_ZERO_TOL
		)
		{
			_SUN_DB = SUN_DB;
			_CODE = CODE;
			_LOOKUP = LOOKUP;
			_UPDATED = UPDATED;
			_CONV_NAME = CONV_NAME;
			_CURR_NAME = CURR_NAME;
			_USE_DAILY = USE_DAILY;
			_DAY_LIMIT = DAY_LIMIT;
			_NET_ACCT_REAL = NET_ACCT_REAL;
			_LOSS_ACCT_REAL = LOSS_ACCT_REAL;
			_GAIN_ACCT_REAL = GAIN_ACCT_REAL;
			_NET_ACCT_NON_REAL = NET_ACCT_NON_REAL;
			_LOSS_ACCT_NON_REAL = LOSS_ACCT_NON_REAL;
			_GAIN_ACCT_NON_REAL = GAIN_ACCT_NON_REAL;
			_PAYMENT_AC = PAYMENT_AC;
			_DEBIT_AC = DEBIT_AC;
			_DEC_PLACES = DEC_PLACES;
			_CURR_UNIT_NAME = CURR_UNIT_NAME;
			_CURR_GENDER = CURR_GENDER;
			_EURO_ZERO_TOL = EURO_ZERO_TOL;
		}
		public SSRFCVDInfo(DataRow dr)
		{
			if (dr != null)
			{
				_SUN_DB = dr[Field.SUN_DB.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.SUN_DB.ToString()]);
				_CODE = dr[Field.CODE.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CODE.ToString()]);
				_LOOKUP = dr[Field.LOOKUP.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.LOOKUP.ToString()]);
				_UPDATED = dr[Field.UPDATED.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.UPDATED.ToString()]);
				_CONV_NAME = dr[Field.CONV_NAME.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CONV_NAME.ToString()]);
				_CURR_NAME = dr[Field.CURR_NAME.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CURR_NAME.ToString()]);
				_USE_DAILY = dr[Field.USE_DAILY.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.USE_DAILY.ToString()]);
				_DAY_LIMIT = dr[Field.DAY_LIMIT.ToString()] == DBNull.Value?0:Convert.ToInt32(dr[Field.DAY_LIMIT.ToString()]);
				_NET_ACCT_REAL = dr[Field.NET_ACCT_REAL.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.NET_ACCT_REAL.ToString()]);
				_LOSS_ACCT_REAL = dr[Field.LOSS_ACCT_REAL.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.LOSS_ACCT_REAL.ToString()]);
				_GAIN_ACCT_REAL = dr[Field.GAIN_ACCT_REAL.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.GAIN_ACCT_REAL.ToString()]);
				_NET_ACCT_NON_REAL = dr[Field.NET_ACCT_NON_REAL.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.NET_ACCT_NON_REAL.ToString()]);
				_LOSS_ACCT_NON_REAL = dr[Field.LOSS_ACCT_NON_REAL.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.LOSS_ACCT_NON_REAL.ToString()]);
				_GAIN_ACCT_NON_REAL = dr[Field.GAIN_ACCT_NON_REAL.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.GAIN_ACCT_NON_REAL.ToString()]);
				_PAYMENT_AC = dr[Field.PAYMENT_AC.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.PAYMENT_AC.ToString()]);
				_DEBIT_AC = dr[Field.DEBIT_AC.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.DEBIT_AC.ToString()]);
				_DEC_PLACES = dr[Field.DEC_PLACES.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.DEC_PLACES.ToString()]);
				_CURR_UNIT_NAME = dr[Field.CURR_UNIT_NAME.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CURR_UNIT_NAME.ToString()]);
				_CURR_GENDER = dr[Field.CURR_GENDER.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CURR_GENDER.ToString()]);
				_EURO_ZERO_TOL = dr[Field.EURO_ZERO_TOL.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.EURO_ZERO_TOL.ToString()]);
			}
		}
		public SSRFCVDInfo(SSRFCVDInfo objEntr)
		{			
			_SUN_DB = objEntr.SUN_DB;			
			_CODE = objEntr.CODE;			
			_LOOKUP = objEntr.LOOKUP;			
			_UPDATED = objEntr.UPDATED;			
			_CONV_NAME = objEntr.CONV_NAME;			
			_CURR_NAME = objEntr.CURR_NAME;			
			_USE_DAILY = objEntr.USE_DAILY;			
			_DAY_LIMIT = objEntr.DAY_LIMIT;			
			_NET_ACCT_REAL = objEntr.NET_ACCT_REAL;			
			_LOSS_ACCT_REAL = objEntr.LOSS_ACCT_REAL;			
			_GAIN_ACCT_REAL = objEntr.GAIN_ACCT_REAL;			
			_NET_ACCT_NON_REAL = objEntr.NET_ACCT_NON_REAL;			
			_LOSS_ACCT_NON_REAL = objEntr.LOSS_ACCT_NON_REAL;			
			_GAIN_ACCT_NON_REAL = objEntr.GAIN_ACCT_NON_REAL;			
			_PAYMENT_AC = objEntr.PAYMENT_AC;			
			_DEBIT_AC = objEntr.DEBIT_AC;			
			_DEC_PLACES = objEntr.DEC_PLACES;			
			_CURR_UNIT_NAME = objEntr.CURR_UNIT_NAME;			
			_CURR_GENDER = objEntr.CURR_GENDER;			
			_EURO_ZERO_TOL = objEntr.EURO_ZERO_TOL;			
		}
        #endregion Constructor
        
        #region InitTable
		public DataTable ToDataTable()
		{
			DataTable dt = new DataTable("SSRFCVD");
			dt.Columns.AddRange(new DataColumn[] { 
				new DataColumn(Field.SUN_DB.ToString(), typeof(String)),
				new DataColumn(Field.CODE.ToString(), typeof(String)),
				new DataColumn(Field.LOOKUP.ToString(), typeof(String)),
				new DataColumn(Field.UPDATED.ToString(), typeof(String)),
				new DataColumn(Field.CONV_NAME.ToString(), typeof(String)),
				new DataColumn(Field.CURR_NAME.ToString(), typeof(String)),
				new DataColumn(Field.USE_DAILY.ToString(), typeof(String)),
				new DataColumn(Field.DAY_LIMIT.ToString(), typeof(Int32)),
				new DataColumn(Field.NET_ACCT_REAL.ToString(), typeof(String)),
				new DataColumn(Field.LOSS_ACCT_REAL.ToString(), typeof(String)),
				new DataColumn(Field.GAIN_ACCT_REAL.ToString(), typeof(String)),
				new DataColumn(Field.NET_ACCT_NON_REAL.ToString(), typeof(String)),
				new DataColumn(Field.LOSS_ACCT_NON_REAL.ToString(), typeof(String)),
				new DataColumn(Field.GAIN_ACCT_NON_REAL.ToString(), typeof(String)),
				new DataColumn(Field.PAYMENT_AC.ToString(), typeof(String)),
				new DataColumn(Field.DEBIT_AC.ToString(), typeof(String)),
				new DataColumn(Field.DEC_PLACES.ToString(), typeof(String)),
				new DataColumn(Field.CURR_UNIT_NAME.ToString(), typeof(String)),
				new DataColumn(Field.CURR_GENDER.ToString(), typeof(String)),
				new DataColumn(Field.EURO_ZERO_TOL.ToString(), typeof(String))
			});
			return dt;
		}
		public DataRow ToDataRow(DataTable dt)
		{
			DataRow row = dt.NewRow();
			row[Field.SUN_DB.ToString()] = _SUN_DB;
			row[Field.CODE.ToString()] = _CODE;
			row[Field.LOOKUP.ToString()] = _LOOKUP;
			row[Field.UPDATED.ToString()] = _UPDATED;
			row[Field.CONV_NAME.ToString()] = _CONV_NAME;
			row[Field.CURR_NAME.ToString()] = _CURR_NAME;
			row[Field.USE_DAILY.ToString()] = _USE_DAILY;
			row[Field.DAY_LIMIT.ToString()] = _DAY_LIMIT;
			row[Field.NET_ACCT_REAL.ToString()] = _NET_ACCT_REAL;
			row[Field.LOSS_ACCT_REAL.ToString()] = _LOSS_ACCT_REAL;
			row[Field.GAIN_ACCT_REAL.ToString()] = _GAIN_ACCT_REAL;
			row[Field.NET_ACCT_NON_REAL.ToString()] = _NET_ACCT_NON_REAL;
			row[Field.LOSS_ACCT_NON_REAL.ToString()] = _LOSS_ACCT_NON_REAL;
			row[Field.GAIN_ACCT_NON_REAL.ToString()] = _GAIN_ACCT_NON_REAL;
			row[Field.PAYMENT_AC.ToString()] = _PAYMENT_AC;
			row[Field.DEBIT_AC.ToString()] = _DEBIT_AC;
			row[Field.DEC_PLACES.ToString()] = _DEC_PLACES;
			row[Field.CURR_UNIT_NAME.ToString()] = _CURR_UNIT_NAME;
			row[Field.CURR_GENDER.ToString()] = _CURR_GENDER;
			row[Field.EURO_ZERO_TOL.ToString()] = _EURO_ZERO_TOL;
			return row;
		}
        #endregion InitTable
    }
}
